package com.googlecode.connectlet.machine.provider.key;

import java.security.PrivateKey;

public class MachinePrivateKey implements PrivateKey {
	private static final long serialVersionUID = 1L;

	private byte[] key;
	private int keySize;

	public MachinePrivateKey(byte[] key, int keySize) {
		this.key = key;
		this.keySize = keySize;
	}

	@Override
	public String getAlgorithm() {
		return "RSA";
	}

	@Override
	public String getFormat() {
		return "Machine-Sealed";
	}

	@Override
	public byte[] getEncoded() {
		return new MachinePrivateKeySpec(this).getEncoded();
	}

	public byte[] getKey() {
		return key;
	}

	public int getKeySize() {
		return keySize;
	}
}